This locution is almost a saying to describe a situation in which you try to win in something and in the end you lose everything, when the cost of an operation turned out to be greater than the benefit, when someone wants to deceive or mock another and ends in evidence. The sheep reference alludes to shearing to obtain wool from sheep, and the figurative sense of sheared by "stripped of something".